package com.wcy.feign.resource;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wcy.entity.ResourceCategory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "cloud-provider-resource", contextId = "FeignResourceCategoryService")
public interface FeignResourceCategoryService {
    //学习资源
    @GetMapping("resourceCategory/page")
    public ResponseEntity<Page<ResourceCategory>> getPage(@RequestParam(name = "pageNum",defaultValue = "1") int pageNum,
                                                          @RequestParam(name = "pageSize",defaultValue = "10") int pageSize);

    @GetMapping("resourceCategory/list")
    public ResponseEntity<List<ResourceCategory>> getList() ;

    @PostMapping("resourceCategory/add")
    public ResponseEntity<Void> add(@RequestBody ResourceCategory learningResource) ;

    @PutMapping("resourceCategory/update")
    public ResponseEntity<Void> update(@RequestBody ResourceCategory learningResource) ;

    @DeleteMapping("resourceCategory/delete/{id}")
    public ResponseEntity<Void> delete(@PathVariable("id") Integer id) ;

    @GetMapping("resourceCategory/get/{id}")
    public ResponseEntity<ResourceCategory> get(@PathVariable("id") Integer id);
}
